<?php if (sizeof($this->comments) > 0) { ?>
<ul>
	<?php foreach ($this->comments AS $key => $val) { ?>
	<li>
		<?php if ($this->answer_info['anonymous'] AND $this->answer_info['uid'] == $val['uid']) { ?>
		<a class="aw-user-name"><img src="<?php echo G_STATIC_URL; ?>/common/avatar-min-img.png" alt="<?php _e('匿名用户'); ?>" /></a>
		<?php } else { ?>
		<a class="aw-user-name" href="people/<?php echo $val['url_token']; ?>" data-id="<?php echo $val['uid']; ?>"><img src="<?php echo get_avatar_url($val['uid'], 'min'); ?>" alt="" /></a>
		<?php } ?>

		<div>
			<p class="clearfix">
			
			<?php if ($this->user_id) { ?>
				<span class="pull-right">
					<?php if (($val['uid'] == $this->user_id AND !$this->question['lock']) OR $this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?><a href="javascript:;" onclick="AWS.User.remove_comment($(this).parent(), '<?php echo $val['question_id'] > 0 ? 'question' : 'answer'; ?>', <?php echo $val['id']; ?>);"><?php _e('删除'); ?></a> &nbsp;<?php } ?>
					<?php if ($this->answer_info['anonymous'] AND $this->answer_info['uid'] == $val['uid']) { ?><?php } else { ?><a href="javascript:;" onclick="if ($(this).parents('.aw-comment-box').find('form textarea').val() == $(this).parents('.aw-comment-box').find('form textarea').attr('placeholder')){$(this).parents('.aw-comment-box').find('form textarea').val('');};$(this).parents('.aw-comment-box').find('form').show().find('textarea').focus();$(this).parents('.aw-comment-box').find('form textarea').insertAtCaret('@<?php echo $val['user_name']; ?>:');$.scrollTo($(this).parents('.aw-comment-box').find('form'), 300, {queue:true});$(this).parents('.aw-comment-box').find('textarea').focus();"><?php _e('回复'); ?></a><?php } ?>
				</span>
			<?php } ?>
			
			<?php if ($this->answer_info['anonymous'] AND $this->answer_info['uid'] == $val['uid']) { ?><a class="aw-user-name author"><?php _e('匿名用户'); ?></a><?php } else { ?><a href="people/<?php echo $val['url_token']; ?>" class="aw-user-name author" data-id="<?php echo $val['uid']; ?>"><?php echo $val['user_name']; ?></a><?php } ?> • <span><?php echo date_friendly($val['time']); ?></span>
			</p>
			<p class="clearfix"><?php echo nl2br($val['message']); ?></p>
		</div>
	</li>
	<?php } ?>
</ul>
<?php } ?>